<%= form_for(@proveedor) do |f| %>
    <% if @proveedor.errors.any? %>
        <div id="error_explanation">
            <h2><%= pluralize(@proveedor.errors.count, "error") %> prohibited this proveedor from being saved:</h2>

            <ul>
                <% @proveedor.errors.full_messages.each do |msg| %>
                    <li><%= msg %></li>
                <% end %>
            </ul>
        </div>
    <% end %>

    <div class="formulario">
        <div class="form-titulo">
            <h2>Datos Generales del <strong>Proveedor</strong></h2>

            <div class="form-buttons">
                <a class="button-adicional" id="dropdownMenu2" data-toggle="dropdown" rel="tooltip" data-placement="top" data-original-title="Mas Acciones">
                    <i class="fa fa-cog"></i>
                </a>
                <a class="button-adicional" href="#" data-toggle="collapse" data-target="#form-data" rel="tooltip" data-placement="top" data-original-title="Colapsar">
                    <i class="fa fa-chevron-down"></i>
                </a>
                <a class="button-adicional" href="#" rel="tooltip" data-placement="top" data-original-title="Ayuda">
                    <i class="fa fa-question-circle"></i>
                </a>

                <%= link_to proveedores_path, class: "btn btn-primary btn-xs" do %>
                    <i class="fa fa-arrow-left"></i> Regresar
                <% end %>
            </div>
        </div>

        <div class="in form-body" id="form-data">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group campo-data">
                        <label>Clave Proveedor</label>
                        <%= f.text_field :ClaveProveedor, :class => "form-control", :tabindex => "1" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Nombre Razon</label>
                        <%= f.text_field :NombreRazon, :class => "form-control", :tabindex => "3" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Ciudad</label>
                        <%= f.text_field :Ciudad, :class => "form-control", :tabindex => "5" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Codigo Postal</label>
                        <%= f.text_field :CodigoPostal, :class => "form-control", :tabindex => "7" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Telefono</label>
                        <%= f.text_field :Telefono, :class => "form-control", :tabindex => "9" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Emails</label>
                        <%= f.text_area :Emails, :class => "form-control txt-area", :tabindex => "11" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Contacto Alterno</label>
                        <%= f.text_field :ContactoAlterno, :class => "form-control", :tabindex => "13" %>
                    </div>

                    <div class="form-group campo-data">
                        <div class="row">
                            <div class="col-sm-6">
                                <label>Dia de Pago</label>
                                <%= f.select :DiaPago, (1..31), {}, {:class => "form-control input-sm", :tabindex => "15"}%>
                            </div>

                            <div class="col-sm-6">
                                <label>Periodo</label>
                                <%= f.select :PeriodoPago, options_for_select([["Semanal", "S"], ["Quincenal", "Q"], ["Mensual", "M"]], @proveedor.PeriodoPago), {}, {:class => "form-control input-sm", :tabindex => "16"} %>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-6">
                    <div class="form-group campo-data">
                        <label>Abreviacion</label>
                        <%= f.text_field :Abreviacion, :class => "form-control", :tabindex => "2" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Direccion</label>
                        <%= f.text_field :Direccion, :class => "form-control", :tabindex => "4" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Estado</label>
                        <%= f.text_field :Estado, :class => "form-control", :tabindex => "6" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>RFC</label>
                        <%= f.text_field :Rfc, :class => "form-control", :tabindex => "8" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Fax</label>
                        <%= f.text_field :Fax, :class => "form-control", :tabindex => "10" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Contacto</label>
                        <%= f.text_field :Contacto, :class => "form-control", :tabindex => "12" %>
                    </div>

                    <div class="form-group campo-data">
                        <label>Responsable Compras</label>
                        <%= f.text_field :ResponsableCompras, :class => "form-control", :tabindex => "14" %>
                    </div>

                    <div class="form-group campo-data">
                        <div class="row">
                            <div class="col-sm-6">
                                <label>Dia de Facturación</label>
                                <%= f.select :DiaFacturacion, (1..31), {}, {:class => "form-control input-sm", :tabindex => "17"} %>
                            </div>

                            <div class="col-sm-6">
                                <label>Periodo</label>
                                <%= f.select :PeriodoFacturacion, options_for_select([["Semanal", "S"], ["Quincenal", "Q"], ["Mensual", "M"]], @proveedor.PeriodoFacturacion), {}, {:class => "form-control input-sm", :tabindex => "18"} %>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group campo-data">
                        <label>Responsable Pagos</label>
                        <%= f.text_field :ResponsablePagos, :class => "form-control", :tabindex => "18"%>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-12 form-header-data">
                    <label class="">DATOS DE GIRO DE LA EMPRESA</label>
                </div>
            </div>

            <div class="row">
                <div class="col-sm-4">
                    <div class="form-group campo-data">
                        <label>Industria</label>
                        <%= f.text_field :Industria, :class => "form-control", :tabindex => "19" %>
                    </div>
                </div>

                <div class="col-sm-4">
                    <div class="form-group campo-data">
                        <label>Sector</label>
                        <%= f.text_field :Sector, :class => "form-control", :tabindex => "20" %>
                    </div>
                </div>

                <div class="col-sm-4">
                    <div class="form-group campo-data">
                        <label>Productos</label>
                        <%= f.text_field :Productos, :class => "form-control", :tabindex => "21" %>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="formulario-footer">
        <%= f.submit "Guardar", :class => "btn btn-primary", :tabindex => "22" %>
        <%= link_to "Cancelar", proveedores_path, :class => "btn btn-default", :tabindex => "23" %>
    </div>
<% end %>
